from rest_framework.viewsets import ModelViewSet
from django.contrib.auth.models import Group,Permission
from meiduo_admin.my_paginate import MyPageNuberPagination
from meiduo_admin.groups_permission.groups_serializer import GroupsPermissionSerializer, GroupsPermissionSimpleSerializer
from rest_framework.generics import ListAPIView

class GroupsPermissionVietSet(ModelViewSet):
    pagination_class = MyPageNuberPagination
    serializer_class= GroupsPermissionSerializer
    queryset = Group.objects.all()


class GroupsPermissionSimpleView(ListAPIView):
    serializer_class = GroupsPermissionSimpleSerializer
    queryset = Permission.objects.all()